﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace ElsProp.Model
{
    public class ItemProperties : ObservableObject
    {
        /// <summary>
        /// 属性名称
        /// </summary>
        private string _PropertiesName;
        /// <summary>
        /// 属性名称
        /// </summary>
        public string PropertiesName { get => _PropertiesName; set => SetProperty(ref _PropertiesName, value); }
        /// <summary>
        /// 属性值
        /// </summary>
        private string _PropertiesValue;

        /// <summary>
        /// 属性值
        /// </summary>
        public string PropertiesValue { get => _PropertiesValue; set => SetProperty(ref _PropertiesValue, value); }

        private int _Condition;
        /// <summary>
        /// 条件
        /// </summary>
        public int Condition { get => _Condition; set => SetProperty(ref _Condition, value); }
        [Newtonsoft.Json.JsonIgnore]
        public ICommand DelCommand { get; set; }
        public event Action<ItemProperties> DeleteThis;
        public ItemProperties()
        {
            DelCommand = new RelayCommand(DelCommandMethod);
        }
        private void DelCommandMethod()
        {
            DeleteThis?.Invoke(this);
        }
    }
}
